package com.zc.study.spring.第一章.practise;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class FileStrImpl implements FileStr {
    private String fileName;

    public FileStrImpl(String fileName) {
        this.fileName = fileName;
    }

    String content;
    @Override
    public String getContent() {
        Properties prop = new Properties();
        InputStream is = this.getClass().getClassLoader().getResourceAsStream(fileName);
        try {
            prop.load(is);
            is.close();
            content = prop.getProperty("appraise");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return content;
    }

}
